let jwt = require("jsonwebtoken");
let secretKey = "2308";  // uid()
console.log(jwt);

// 生成秘钥
// jwt.sign(data,secretKey,option)
// let data = { user: "a123123", phone: "17386141517", email: "123123@qq.com" }
// let token = jwt.sign(data, secretKey, {
//     expiresIn: 10, // 过期时间(单位:s)
// })
// console.log(token);

// 解析秘钥 
var str = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYTEyMzEyMyIsInBob25lIjoiMT123123czODYxNDE1MTciLCJlbWFpbCI6IjEyMzEyM0BxcS5jb20iLCJpYXQiOjE2OTk1MDAwMDEsImV4cCI6MTY5OTUwMDAxMX0.1Bao_N5Jap_xxmNPxXOjSylvNMmCmaDofKd84xEfyNE"

var result = jwt.verify(str, secretKey);
console.log(result);


